import request from '../utils/request'

function login(data) {
    return request({
        url: '/api/admin/login',
        method: 'POST',
        data
    })
}

function getCaptcha() {
    return request({
        url: '/api/getCaptcha',
        method: 'GET',
    })
}

function GetUserMessage() {
    return request({
        url: '/api/admin/user/information',
        method: 'GET'
    })
}

function UpdateUserMessage(data) {
    return request({
        url: '/api/admin/change/user/message',
        method: 'PUT',
        data
    })
}

function CheckToekn() {
    return request({
        url: '/api/checktoken',
        method: 'GET'
    })
}

function Logout() {
    return request({
        url: '/api/admin/logout',
        method: 'POST'
    });
}

function UpdatePassword(data) {
    return request({
        url: '/api/admin/passwd/reset',
        method : 'put',
        data
    });
}

export {
    login, getCaptcha, GetUserMessage, CheckToekn, UpdateUserMessage, Logout,UpdatePassword
}